﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcShop.Core.Extension;
using System.Web.Mvc;
using System.Reflection;

namespace MvcShop.Extensions.Html
{
    public static class UrlExtension
    {
        public static string Resources(this UrlHelper helper, string resourcesName)
        {
            return helper.Content("~/resources.axd") + "?name={0}".FormatWith(resourcesName);
        }

        public static string Image(this UrlHelper helper, string fileName)
        {
            return helper.Content("~/Assets/Images/{0}".FormatWith(fileName));
        }

        public static string Image(this UrlHelper helper,string alt,string fileName)
        {
            var filePath = helper.Content(fileName);
            return "<img alt=\"{0}\" src=\"{1}\" />".With(alt,filePath);
        }
    }
}
